package com.runchamp;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class CustomDialog implements OnClickListener {
    Dialog dialog;
    Button km1, km2, km4, km5, km7, km10;
    Intent myracesIntent;

    public CustomDialog(Context context, int layout) {
        dialog = new Dialog(context);
        km1 = (Button) dialog.findViewById(R.id.km1);
        km2 = (Button) dialog.findViewById(R.id.km2);
        km4 = (Button) dialog.findViewById(R.id.km4);
        km5 = (Button) dialog.findViewById(R.id.km5);
        km7 = (Button) dialog.findViewById(R.id.km7);
        km10 = (Button) dialog.findViewById(R.id.km10);
    }

    @Override
    public void onClick(View v) {
        // Create custom dialog object

        // Include dialog.xml file
        dialog.setContentView(R.layout.quickdialog);
        // Set dialog title
        dialog.setTitle("Choose Distance");

        // set values for custom dialog components - text, image and button
          /*  TextView text = (TextView) dialog.findViewById(R.id.textDialog);
            text.setText("Custom dialog Android example.");
            ImageView image = (ImageView) dialog.findViewById(R.id.imageDialog);
            */
        dialog.show();

        Button declineButton = (Button) dialog.findViewById(R.id.declineButton);
        // if decline button is clicked, close the custom dialog
        declineButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                // Close dialog
                dialog.dismiss();
            }
        });


    }

    public void kmClick(View v) {
        if (v == km1) {

        } else if (v == km2) {

        } else if (v == km4) {

        } else if (v == km5) {

        } else if (v == km7) {

        } else if (v == km10) {

        }
    }


}